home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
FM Towns: Free Software Collection 7
/
FM Towns Free Software Collection 7.iso
/
taropyon
/
guilib3
/
prg
/
dll
/
bgm
/
bgmtst.c
< prev
next >
Wrap
C/C++ Source or Header
|
1993-11-30
|
2KB
|
125 lines
/*************************************************************************
* BGM.DLL テストプログラム
*************************************************************************/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <egb.h>
#include <snd.h>
#include <sidework.h>
#include <xld.h>
#include <setint.h>
#include <disp.h>
#include <dialog.h>
#include <fslib.h>
#include <mouse.h>
#include <fdl.h>
#include "midi.h"
static PLT_RGB PltDat[16] =
{
/* G R B */
{ 0, 0, 0}, /* C_BALCK */
{ 0, 0, 0}, /* C_BLUE or C_THROUGH */
{ 7, 7, 8}, /* C_RED */
{12,12,13}, /* C_MAGENTA */
{ 6, 5, 7}, /* C_GREEN */
{ 8, 7, 9}, /* C_CYAN */
{10, 9,11}, /* C_YELLOW */
{11,11,12}, /* C_WHITE */
{ 5, 5, 6}, /* C_HBALCK */
{ 0, 0,11}, /* C_HBLUE */
{ 0,11, 0}, /* C_HRED */
{ 0,11,11}, /* C_HMAGENTA */
{11, 0, 0}, /* C_HGEEN */
{11, 0,11}, /* C_HCYAN */
{11,11, 0}, /* C_HYELLOW */
{14,14,15} /* C_HWHITE */
};
void main(int argc, char **argv)
{
int i;
set_ctrl_c();
set24h();
if ( SndPtr == NULL )
{
if ( (SndPtr = calloc(16384,1)) == NULL )
return;
SND_init( SndPtr );
}
DSP_sysInit(NULL);
DSP_set_defFnt( FNTYPE_USR1 );
GetFnt12Ptr(0);
for ( i = 0; i < 2; ++i )
{
DSP_writePage(i);
DSP_setPlt(PltDat);
}
KBF_sysInit();
FDL_sysInit();
sdk_control(0);
_XLD_init(NULL);
_XLD_setMemFunc( malloc, free );
{
char tmp[256];
int len;
FS_setStartPath( tmp, argv[0] );
if ( (len = strlen(tmp)) > 0 )
tmp[--len] = '\0';
_XLD_setLinkPath( tmp );
}
_XLD_lockLib( MID_playStatFlag );
MID_sysInit();
/* ファイルダイアログで使うワイルドカード */
FdlSetWildCardList( "*.[me][iu][dp]" );
FdlSetWildCardList( "*.mid" );
FdlSetWildCardList( "*.eup" );
DSP_writePage(1);
FDL_T *fdl = NULL;
if ( (fdl = FDL_open(FDL_MODE_DEFAULT)) == NULL )
goto _RET;
FDL_set_title( fdl, "BGM PLAY");
LOOP
{
int ret;
char *fn;
FDL_set_wildcard( fdl, "*.[me][iu][dp]"); /* デフォルトワイルドカード */
ret = FDL_start(fdl);
fn = FDL_get_filename(fdl);
if ( ret != NORMAL || strlen(fn) == 0 )
break;
{
MID_playStart(fn);
}
}
_RET:
MID_sysEnd();
FDL_sysEnd();
KBF_sysEnd();
DSP_sysEnd();
if ( SndPtr )
{ SND_end();
free(SndPtr);
SndPtr = NULL;
}
reset24h();
}